package com.example.base.log;

import java.util.*;

public class LogUtils {

    private static volatile Map<String,LogModel>  LOG_MAP=new HashMap<>();


    public static void addLogModel(String className,LogModel logModel){
        if(LOG_MAP.containsKey(className)){
            LogModel model=LOG_MAP.get(className);
            model=null;
        }
        LOG_MAP.put(className,logModel);
    }

    public static void wirteLog(String className,String logText){
        for (LogModel model : LOG_MAP.values()) {
            model.addLog(className, logText);
        }
    }

    public static void clear(String className){
        LOG_MAP.remove(className);
    }

}
